import React,{ Component } from 'react';
import { Flex } from 'antd-mobile';
import {
    withRouter
} from 'react-router-dom';
class JobItem extends Component{
    constructor(props){
        super(props);
    }
    gotoItemDeatil(url){
        this.props.history.push("/"+url)
    }   

    render(){
        const flexItem = this.props.job.map((obj) =>
            <Flex.Item key={obj.id} onClick={this.gotoItemDeatil.bind(this,obj.url)}>
                <span className={'iconSpan ' + obj.bgClass} >
                    <i className={'iconfont ' + obj.tuClass}></i>
                    <span>{obj.name}</span>
                </span>     
            </Flex.Item>
        );
        return (
            <Flex>
                {flexItem}
            </Flex>
        )
    }
}
export default withRouter(JobItem);